package com.common.core.config;

import com.common.core.utils.ResourceUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.stereotype.Component;

/**
 * @auther zhangwj
 * @date 2021/11/27 下午9:57
 */
@Component
public class GlobalLogEnvironment implements EnvironmentPostProcessor {

    @Override
    public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
        String profile = "element-core-logs.properties";
        environment.getPropertySources().addLast(ResourceUtil.getPropertySource(profile));
    }
}
